package com.k8s.hello.web;

import com.k8s.hello.client.BaseService;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;

@RestController
@RequestMapping("hello")
public class HelloResource {

    private final BaseService baseService;

    public HelloResource(BaseService baseService) {
        this.baseService = baseService;
    }

    @GetMapping("config")
    public ResponseEntity<Map<String,Object>> getConfig(){
        return ResponseEntity.ok(baseService.getConfig());
    }

}
